﻿@using MealBooking.Core.Models.Meals;
@model MealCategory
@{
    ViewBag.HeaderTitle = Model.Name;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<ul data-role="listview" data-inset="true">
    @{
        var mealCategory = Model;
        <li data-role="list-divider">
            <p>@mealCategory.Description</p>
        </li>
        <li>
            <div data-role="navbar">
                <ul>
                    <li><a href="#">Edit</a></li>
                    <li><a href="" data-theme="e">Delete</a></li>
                </ul>
            </div>
            <!-- /navbar -->
        </li>
        <li data-role="list-divider">Dish Categories: <span class="ui-li-count">
            @mealCategory.DishCategories.Count</span></li>
        <li>
            <div data-role="controlgroup">
                <ul data-role="listview" data-inset="true" data-mini="true">
                    @{
                        foreach (var dishCat in mealCategory.DishCategories)
                        { 
                        <li><a title="@dishCat.Description" href="@Url.Action("DishCategoryDetail", "Dish", null)">
                            @dishCat.Name</a></li>
                        }
                    }
                </ul>
            </div>
        </li>
        <li data-role="list-divider">Templates: <span class="ui-li-count">
            @mealCategory.MealTemplates.Count</span></li>
        <li>
            <div data-role="controlgroup">
                <ul data-role="listview" data-inset="true" data-mini="true">
                    @{ foreach (var template in mealCategory.MealTemplates)
                       { 
                        <li><a href="@Url.Action("TemplateDetail", "Meal", new { mealTemplateId = template.Id })">
                            @template.Name</a> </li>} }
                </ul>
            </div>
        </li>}
</ul>
